package com.mao.demo2;

public class GoldCard extends Card{
    public GoldCard( String cardId, String name, String phone, double money) {
        super(cardId, name, phone, money);
    }

    @Override
    public void consume(double money) {
        System.out.println("您当前金卡的消费：" + money);
        System.out.println("优惠后的价格：" + money*0.8);
        if(getMoney() < money*0.8)
        {
            System.out.println("您的余额不足，请充值");
            return;
        }
        setMoney(getMoney()-money*0.8);
        // 判断大于200，打印洗车票
        if(money*0.8>=200)
        {
            printTicket();
        }else {
            System.out.println("您本次消费不足200，不能免费洗车。");
        }
    }
    public void printTicket()
    {
        System.out.println("您本次消费了,打印洗车票");
    }
}
